#ifndef MODBUSWIG_H
#define MODBUSWIG_H

#include <QWidget>
#include "slideswitch.h"
#include <QDebug>
#include <QMap>
#include <QBoxLayout>
#include <QJsonObject>
#include <QSizePolicy>
#include <QJsonArray>
#include <QLabel>
#include <QMovie>
#include <QJsonDocument>
#include <QPixmap>
#include "mqtt/qmqtt.h"



namespace Ui {
class ModbusWig;
}

class ModbusWig : public QWidget
{
    Q_OBJECT

public:
    explicit ModbusWig(QWidget *parent = 0);
    ~ModbusWig();
    QMap<QString,int> switchMap;
     void createSlideSwitch(QBoxLayout *layout, int keyValue, QLabel * label);
     void switchCtlToUi(QJsonObject jsonData);

private:
    Ui::ModbusWig *ui;
    void switchChangeSlot(bool checked);
    QMap<int, SlideSwitch*> slideMap;
    QMap<int, QLabel*> labelMap;
    QMap<int, QString> pngMap;
    QMap<int, QString> pngOnMap;
//    QMap<int, QMovie*> gifMap;

};

#endif // MODBUSWIG_H
